import subprocess
from functools import partial
# 解决execjs执行js时产生的乱码报错，需要在导入execjs模块之前，让Popen的encoding参数锁定为utf-8
subprocess.Popen = partial(subprocess.Popen, encoding='utf-8')
import execjs

with open('20250503-run.js', 'r', encoding='utf-8') as f:
    js_code = f.read()

context = execjs.compile(js_code)

def get_anti_content():
    anti_content = context.call('getAntiContent')
    # print('anti_content = ', anti_content)
    return anti_content

def get_proxy_no():
    # 二店
    # return 'o0OvZlbhjpYoUqb0sjXzxA=='
    return None

def get_access_token():
    # 替换下面 accesstoken 的值
    return 'P5OJ67TVAY7KFAGHB3LQ3EBLXQDMT3RVWFMNTVPT35QY3UZUS7NQ1200774'
